In [1]:
%load_ext autoreload
%autoreload 2
%matplotlib inline
from scipy.optimize import newton
import scipy.constants as sc
import numpy as np
import matplotlib.pyplot as plt
In [2]:
from pypvcell.solarcell import HighPSQCell,DiodeSeriesConnect
from pypvcell.illumination import load_astm
In [3]:
hp1=HighPSQCell(1.42,cell_T=300)
In [4]:
test_v=np.linspace(-1,1,10)
In [5]:
hp1.get_j_from_v(test_v)
Out[5]:
In [6]:
hp1.get_j_from_v(test_v,to_tup=True)
Out[6]:
In [7]:
hp1.set_input_spectrum(load_astm())
In [8]:
test_i=hp1.get_j_from_v(test_v,to_tup=True)
print(test_i)
In [9]:
hp1.get_v_from_j(test_i)
Out[9]:
In [10]:
hp1.get_v_from_j_numerical(-hp1.jsc)
Out[10]:
In [11]:
hp1.get_v_from_j((-hp1.jsc+0.01,0))
Out[11]:
In [12]:
hp1.get_v_from_j_numerical(-320,3.0)
Out[12]:
In [13]:
hp1.get_j_from_v(0.1,to_tup=True)
Out[13]:
In [14]:
hp1.get_single_j_from_v_bisect_fancy(1.0,(-hp1.jsc,-20))
Out[14]:
In [15]:
hp2=HighPSQCell(1.42,cell_T=300)
hp2.set_input_spectrum(0.2*load_astm())
hp3=HighPSQCell(1.42,cell_T=300)
hp3.set_input_spectrum(0.4*load_astm())
d1=DiodeSeriesConnect([hp1,hp2,hp3])
In [16]:
v,i=d1.construct_iv()
In [ ]:
test_v=np.linspace(-5,1.1,num=100)
In [ ]:
i1=hp1.get_j_from_v(test_v)
i2=hp2.get_j_from_v(test_v)
i3=hp3.get_j_from_v(test_v)
plt.plot(test_v,i1)
plt.plot(test_v,i2)
plt.plot(test_v,i3)
In [17]:
plt.plot(v,i)
In [18]:
d1.get_single_j_from_v(1.0)
Out[18]:
In [19]:
d1.get_j_from_v(1.0)
Out[19]:
In [77]:
top_cell=HighPSQCell(1.87,cell_T=300)
mid_cell=HighPSQCell(1.42,cell_T=300)
bot_cell=HighPSQCell(0.67,cell_T=300)
In [78]:
d2=DiodeSeriesConnect([top_cell,mid_cell,bot_cell])
In [79]:
d2.set_input_spectrum(load_astm())
In [80]:
top_cell.jsc,mid_cell.jsc,bot_cell.jsc
Out[80]:
In [81]:
v=np.linspace(-1,2.9,100)
j=d2.get_j_from_v(v)
In [82]:
plt.plot(v,j,'.-')
Out[82]:
In [83]:
import copy
In [84]:
d3=copy.deepcopy(d2)
d3.set_input_spectrum(0.1*load_astm())
d5=copy.deepcopy(d3)
d5.set_input_spectrum(0.2*load_astm())
In [85]:
d4=DiodeSeriesConnect([d2,d3,d5])
In [86]:
v=np.linspace(-2,8.7,100)
j=d4.get_j_from_v(v)
In [87]:
plt.plot(v,j,'.-')
Out[87]:
In [88]:
print(j)
In [ ]:
In [ ]:
In [ ]: